const router = require('koa-router')();
const enviro = require('../modules/enviro');

//获取数据
router.get('/city/enviro',async(ctx,next) => {
    ctx.body = await enviro.getEnviro();
})

//增加数据
router.post('/city/enviro',async(ctx,next) => {
    ctx.body = await enviro.addEnviro(ctx.request.body);
})

//删除数据
router.delete('/city/enviro/:recomID/:cityID',async(ctx,next) => {
    ctx.body = await enviro.deleteEnviro(ctx.params);
})

//更改数据
router.put('/city/enviro',async(ctx,next)=>{
    ctx.body = await enviro.putEnviro(ctx.request.body);
  })

module.exports = router;